package com.function;

import com.function.CondumerDemo;

import java.util.function.Consumer;

public class ConsumerTest {
    public static void main(String[] args) {
        Consumer<String> consumer = new Consumer<String>() {

            @Override
            public void accept(String s) {
                System.err.println(s);
            }
        };
        consumer.accept("字符串");
        Consumer<String> consumer1=s->{
            System.out.println(s);
        };
       consumer1.accept("tingting");

       Consumer<String> consumer2 =System.out::print;
       consumer2.accept("woaitingting");
        CondumerDemo condumerDemo = new CondumerDemo();
        condumerDemo.processData(s-> System.out.println(s),"我们自己的测试数据");
        condumerDemo.processData(System.out::println,"我们的数据");
    }

}
